package com.wqm.step.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wqm.step.mapper.PersonMapper;
import com.wqm.step.pojo.Person;
import com.wqm.step.pojo.PersonExample;
import com.wqm.step.service.PersonService;

@Service
public class PersonServiceImpl implements PersonService {

	@Autowired
	private PersonMapper personMapper;
	
	@Override
	public List<Person> findAllPersons() {
		PersonExample example = new PersonExample();
		List<Person> allPerson = personMapper.selectByExample(example);
		return allPerson;
	}

	@Override
	public Person findPersonById(Integer id) {
		Person person = personMapper.selectByPrimaryKey(id);
		return person;
	}

	@Override
	public void savePerson(Person person) {
		System.out.println("Person数据..........."+person);
		personMapper.insert(person);
	}

}
